#include <my_header.h>
// 最终捕获返回11
/* Usage: ./9_pthread_join_return_主动退出.c */

void * fun1(void * arg){ 
    sleep(5);
    return (void *)11;
}
int main()
{
    pthread_t pid;
    int ret = pthread_create(&pid, NULL, fun1, NULL);
    THREAD_ERROR_CHECK(ret, "pthread_cetate");

    void *numP;
    int ret_join = pthread_join(pid, &numP);
    THREAD_ERROR_CHECK(ret_join, "pthread_join");

    printf("catch from child thread return value = %ld \n",  (long)numP);
    return 0;
}

